var $window = $(window),           
	ww = $window.width(),
	wh = $window.height();

if(ww<=500){
    $('#message').removeClass('pc_msg');
    $('#message').addClass('position_center');
    $('.message-box').addClass('position_center');
    
}

$(function() {
    /*var ws = new ScrollWatch({
        watchOffset: -50,
        onElementInView:function(data){

        }
    });*/
	$('.m-close').click(function() {
		if ($('body').hasClass('on')) {
			$('body').removeClass('on');
		} else {
			$('body').addClass('on');
		} 
	});

	
    // 侧栏
    $('.aside-nav-close').click(function() {
        $('.aside-nav').stop().animate({right:"-100px"},625,"easeOutCubic");
    });
   

    $(function () {  
        $(window).scroll(function(){  
            if ($(window).scrollTop()<=100){  
                $('.aside-nav').stop().animate({right:"30px",opacity:1},625,"easeOutCubic");
            }  
        });  
    })
})

window.onload = function(){
    $('aside').css('opacity',1);
    $('#message').css('opacity',1);

}


function backTop(){
    $('body,html').animate({scrollTop: 0},600);
}

var IE = null;
if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion .split(";")[1].replace(/[ ]/g,"")=="MSIE6.0") 
{ 
    IE = 6;
} 
else if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion .split(";")[1].replace(/[ ]/g,"")=="MSIE7.0") 
{ 
    IE = 7;
} 
else if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion .split(";")[1].replace(/[ ]/g,"")=="MSIE8.0") 
{ 
    IE = 8;
} 
else if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion .split(";")[1].replace(/[ ]/g,"")=="MSIE9.0") 
{ 
    IE = 9;
} 

if (IE==6||IE==7||IE==8){
    window.location.href='http://cdn.dmeng.net/upgrade-your-browser.html?referrer='+location.href;
}



